<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %><%--
  Created by IntelliJ IDEA.
  User: XiangLang15078435014
  Date: 2021/11/1
  Time: 20:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
    <head>
        <title>Title</title>
    </head>
    <body>

        <%--<%
            /*//不可以加
            response.setCharacterEncoding("utf-8");
            request.setCharacterEncoding("utf-8");
            */

            //调用request的方法获取前端传输的数据
            String sname = request.getParameter("sname");
            sname = new String(sname.getBytes("ISO-8859-1"), "UTF-8");
            String name = new String(request.getParameter("sname").getBytes("iso-8859-1"), "utf-8");
            String password = request.getParameter("password");
            out.print(sname + name + password);
        %>--%>

        <%--使用JavaBean获取前端输出的数据
                把前端数据存入到javaBean中
        --%>


        <%
            request.setCharacterEncoding("utf8");
            response.setCharacterEncoding("utf8");
        %>
            <%--默认：scope="page"--%>
        <jsp:useBean id="student" class="com.edu.oracle.entity">
            <jsp:setProperty name="student" property="sno" param="name"></jsp:setProperty>
            <jsp:setProperty name="student" property="password"></jsp:setProperty>
        </jsp:useBean>


        <%--把数据从javaBean中取出来--%>
        <jsp:getProperty name="student" property="sno"/><br>
        <jsp:getProperty name="student" property="password"/>

        <%--
            //转发：则执行到forward语句后，跳转到对应的页面，不会显示当前页面内容
            <jsp:forward page="login.jsp"></jsp:forward>

             //include则回把其他页面包含进来
            <jsp:include page="login.jsp"></jsp:include>
        --%>


    </body>
</html>
